package com.bosch.in.rtp1.ept.manager;

import java.io.IOException;
import java.io.InputStream;
import java.sql.SQLException;
import java.util.List;
import java.text.ParseException;

import net.sf.jasperreports.engine.JRException;
import net.sf.jasperreports.engine.JasperPrint;

import org.apache.poi.ss.usermodel.Workbook;

import com.bosch.in.rtp1.ept.model.dto.DurationColorCon;
import com.bosch.in.rtp1.ept.model.dto.LotStatus;
import com.bosch.in.rtp1.ept.model.technical.Condition4LotStatus;

/**
 * Business Delegate interface to define contract of service which is used to manipulate data
 * on LotStatus table
 * @author TPR1HC
 *
 */
public interface LotStatusManager {
	
	/**
	 * Get  list of LotStatus according to given searchCriteria 
	 * @param searchCriteria	specify search condition, order column and range of returned values
	 * @return list of LotStatus object
	 * @throws SQLException 
	 */
	List<LotStatus> getLotStatus(Condition4LotStatus searchCriteria) throws SQLException ;
	
//	/**
//	 * Get LotStatus list from database and populate it to excel sheet.
//	 * @param searchCriteria	SQL condition criteria
//	 * @param is	inputStream to excel template file which is filled by LotStatus list
//	 * @return	excel object
//	 * @throws IOException 
//	 * @throws SQLException 
//	 */
//	Workbook exportToExcel(Condition4LotStatus searchCriteria, InputStream is, DurationColorCon durCorCon) throws IOException, SQLException ;
	
	/**
	 * Convert json string to LotStatus list and export to excel sheet.
	 * @param searchCriteria	SQL condition criteria
	 * @param jsonLotStatuses	json string contains lot status list from client side
	 * @param is				inputStream to excel template file which is filled by LotStatus list
	 * @param durCorCon			duration condition to format background color of waittime column
	 * @return	excel object
	 * @throws IOException 
	 * @throws SQLException 
	 * @throws ParseException
	 */
	Workbook exportToExcel(Condition4LotStatus searchCriteria, String jsonLotStatuses, InputStream is, DurationColorCon durCorCon) throws IOException, SQLException, ParseException;
	
//	/**
//	 * Get LotStatus list from database and populate it to pdf file.
//	 * @param searchCriteria		SQL condition criteria
//	 * @param is					inputStream to pdf template file which is filled by LotStatus list
//	 * @return pdf object
//	 * @throws SQLException 
//	 * @throws JRException 
//	 */
//	JasperPrint exportPdf(Condition4LotStatus searchCriteria, InputStream is) throws SQLException, JRException ;
	
	/**
	 * Get LotStatus list from database and populate it to pdf file.
	 * @param searchCriteria		SQL condition criteria
	 * @param jsonLotStatuses	json string contains lot status list from client side
	 * @param is					inputStream to pdf template file which is filled by LotStatus list
	 * @return pdf object
	 * @throws SQLException 
	 * @throws JRException 
	 */
	JasperPrint exportPdf(Condition4LotStatus searchCriteria, String jsonLotStatuses, InputStream is) throws SQLException, JRException, ParseException ;
}
